package caiwei.android.activity.base;

import caiwei.android.R;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * 主Grid的内部项目基础类Activity
 * 
 * @author caiwei
 * @date2012-3-19
 * @version 1.0
 */
public abstract class ActivityGridItemBase extends ActivityFrame
{
	protected ListView mListView;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		appendMainBody(R.layout.grid_base);
		initView();
		initVariable();
		bindData();
	}

	private void bindData()
	{
		mListView.setAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, initVariable()));
	}

	protected abstract String[] initVariable();

	private void initView()
	{
		mListView = (ListView) findViewById(R.id.lvgridbase);
	}
}
